Prerequisites
Before installing PVAC-HFHE, ensure your development environment meets these requirements:1
C++17 compiler
You need a compiler that supports C++17 or later:
- GCC: Version 9 or higher
- Clang: Version 10 or higher
- MSVC: Visual Studio 2019 or higher
2
x86-64 processor (recommended)
For optimal performance, use a processor with PCLMUL support. Most modern Intel and AMD processors include this instruction set.Check PCLMUL support on Linux:
PVAC-HFHE will work without PCLMUL, but cryptographic operations will be slower.
Clone the repository
PVAC-HFHE is a header-only library, so installation is straightforward:Project structure
After cloning, your directory should look like this:Include in your project
PVAC-HFHE is header-only, so you just need to add the include path:Compiler flags explained
Verify installation
Test your installation by building and running the examples:1
Build examples
examples/ directory.2
Run basic usage example
3
Run test suite (optional)
Verify everything works correctly by running the full test suite:This runs 42 comprehensive tests covering all library functionality.
Integration methods
Method 1: Direct include path
Add the PVAC-HFHE include directory to your compiler flags:Method 2: Copy headers to system path
Copy headers to your system include directory:-I flag:
Method 3: CMake integration
For CMake projects, add the include directory:CMakeLists.txt
Troubleshooting
Compiler error: 'std::optional' not found
Compiler error: 'std::optional' not found
This indicates your compiler doesn’t fully support C++17. Update to:
- GCC 9 or higher
- Clang 10 or higher
- MSVC 2019 or higher
Undefined reference errors during linking
Undefined reference errors during linking
PVAC-HFHE is header-only and doesn’t require linking. Ensure you’re including
pvac/pvac.hpp in your source files.Slow performance
Slow performance
Ensure you’re compiling with optimization flags:
- Add
-O2or-O3for optimization - Add
-march=nativeto enable CPU-specific instructions - Check that your CPU supports PCLMUL instructions
Cannot find pvac/pvac.hpp
Cannot find pvac/pvac.hpp
Verify the include path is correct:
Next steps
Quickstart guide
Build your first homomorphic encryption application.
Basic operations
Learn the fundamental operations for working with encrypted data.